package 代理模式;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class DogDynamicProxy implements InvocationHandler {

    /**
     * 被代理的对象
     */
    private Object obj;

    public DogDynamicProxy(Object obj) {
        this.obj = obj;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("动态代理...");
        return method.invoke(obj, args);
    }
}
